//
//  RMMessageModel.swift
//  TestDemo
//
//  Created by xiong on 2025/8/28.
//

import UIKit
@objc
class RMMessageModel: NSObject {
    // MARK: - 通讯 <message> 部分
    var messageId: String = UUID().uuidString   // 消息标识号
    var fromId: String = ""                     // 发送者ID
    var toId: String = ""                       // 目标ID
    var nickname: String = ""                   // 昵称
    var headimgurl: String = ""                 // 头像URL
    
    // MARK: - 通讯 <body> 部分
    var type: Int = 0
    var subtype: Int = 0
    var fromUserId: String = ""
    var fromUserName: String = ""
    var toUserId: String = ""
    var toUserName: String = ""
    var content: String = ""                    // 内容或URL
    var fileName: String = ""
    var objectId: String = ""
    var fileSize: Int = 0
    var timeLen: Int = 0
    var location_x: Int = 0                // 经度或图片宽
    var location_y: Int = 0                // 纬度或图片高
    var isReadDel: Int = 0                 // 阅后即焚
    var isEncrypt: Int = 0                 // 加密方式
    var timeSend: Double = 0.0                  // 发送时间
    var deleteTime: Double = 0.0                      // 消息过期时间
    
    // MARK: - 数据库字段
    var messageNo: Int = 0
    var isSend: Int = 0
    var isRead: Int = 0
    var isReceive: Int = 0
    var isUpload: Int = 0
    var timeReceive: Double = 0.0                      // 收到时间
//    var fileData: Data?                                // 文件内容
    var readPersons: Int = 0
    var readTime: Double = 0.0                        // 已读时间
    var chatMsgHeight: String = "0"
    var isNotUpdateHeight: Bool = false
    var signature: String = ""
    var isVerifySignatureFailed: Int = 0
    var generalMark: Int = 0
    var srvId: String = ""
    
    // MARK: - 内存变量
    var isMySend: Bool = false
    var isGroup: Bool = false
    var isShowTime: Bool = false
    var isDelay: Bool = false
    var imageWidth: Int = 0
    var imageHeight: Int = 0
    var dictionary: NSMutableDictionary = [:]
    var progress: Float = 0
    var index: Int = 0
    var sendCount: Int = 0
    var updateLastContent: Bool = false
    var showRead: Bool = false
    var other: String = ""
    var changeMySend: Int = 0
    var isRepeat: Bool = false
    var isMultipleRelay: Bool = false
    var isShowWait: Bool = false
    var chatType: Int = 0
    var isShowRemind: Bool = false
    var remindType: Int = 0
    var isGroupSend: Bool = false
    var isLastGroupSend: Bool = false
    var isNoEncrypt: Bool = false
    var lastToUserId: String = ""
    var roomName: String = ""
    var isChangeAccept: Bool = false
    var isEndDelayMsg: Bool = false
    var seqNo: Int = 0
    var isPullMsg: Bool = false
    var speechMsg: String = ""
    var bubbleBgWith: CGFloat = 0
    var isActivity: Bool = false
    var imageCache: UIImage?                    // 缓存图片
    var shareJson: String = ""
}
